package com.leonzx.base.config.jim.init;

import com.leonzx.base.config.jim.ImServerStart;
import org.jim.common.ImConfig;
import org.jim.common.http.HttpConfig;

/**
 * 
 * @author Liang
 *
 */
public class HttpServerInit {

	public static void init(ImConfig imConfig, String pageRoot) throws Exception {
		String[] scanPackages = new String[] { ImServerStart.class.getPackage().getName() };//j-im mvc需要扫描的根目录包
		HttpConfig httpConfig = new HttpConfig();
		httpConfig.setPageRoot(pageRoot);//设置web访问路径;
		httpConfig.setMaxLiveTimeOfStaticRes(0);//不缓存资源;
		httpConfig.setScanPackages(scanPackages);//设置j-im mvc扫描目录;
		imConfig.setHttpConfig(httpConfig);
	}
}
